﻿using UnityEngine;
using System.Collections;

namespace CHFramework
{
    public delegate void InputHandler();

    public class EventData
    {
        /// <summary>
        /// 消息处理代码。比如m_EventID = 0，表示接受服务器消息成功；m_EventID = 1，服务器交互失败，当晚游戏货币不足
        /// 时候不能强化等功能，UI层根据不同的m_EventCode作相应的处理（强化成功或失败的处理）
        /// </summary>
        protected int m_EventID = 0;
        public int EventID
        {
            get { return m_EventID; }
        }

        protected int m_EventCode = 0;
        public int EventCode
        {
            get { return m_EventCode; }
        }

        protected object m_EventParam = null;
        public object EventParam
        {
            get { return m_EventParam; }
            set { m_EventParam = value; }
        }

        public EventData(int eventId, int eventCode = 0)
        {
            this.m_EventID = eventId;
            this.m_EventCode = eventCode;
        }

        public EventData(int eventId, int eventCode, object eventParam)
        {
            this.m_EventID = eventId;
            this.m_EventCode = eventCode;
            this.m_EventParam = eventParam;
        }
    }
}
